package com.repository;

import com.entity.SysVersionManage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * @author Yadasu
 * @date 2021/2/25 15:56
 */
public interface SysVersionPagingAndSortingRepository extends PagingAndSortingRepository<SysVersionManage,Integer>, JpaRepository<SysVersionManage,Integer>, JpaSpecificationExecutor<SysVersionManage> {

    @Query(value = "select * from sys_installation_package_manage where installation_package_name=?1",nativeQuery = true)
    Page<SysVersionManage>findAllByPackageName(String username,Pageable pageable);

    @Query(value = "select * from sys_installation_package_manage where deploy_id=?1",nativeQuery = true)
    Page<SysVersionManage>findAllByDeployId(Integer id,Pageable pageable);


}
